﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Abp.Application.Services.Dto;
using DualControl.CompanyInfos;
using DualControl.CompanyInfos.Dtos;
using DualControl.Controllers;
using Microsoft.AspNetCore.Mvc;

namespace DualControl.Web.Mvc.Controllers
{
    public class CompanyInfoController : DualControlControllerBase
    {
        private readonly ICompanyInfoAppService _companyInfoAppService;

        public CompanyInfoController(CompanyInfoAppService companyInfoAppService)
        {
            _companyInfoAppService = companyInfoAppService;
        }

      
        public async Task<ActionResult> Index()
        {
            // _jobManager.ScheduleGenerateCheckTask();
            var companyinfo = await _companyInfoAppService.GetCompanyInfoAsync();
            return View(companyinfo);
        }

        //编辑
        public async Task<ActionResult> EditCompanyInfoModal(int companyinfoId)
        {
            var companyinfo = await _companyInfoAppService.GetCompanyInfoForEdit(new NullableIdDto<int>(companyinfoId));

            return View("_EditCompanyInfoModal", companyinfo.CompanyInfo);
        }
    }
}